Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(flags) remove deprecated flags #866

Merged
merged 2 commits into from
Sep 25, 2020
Merged

Conversation

rainest
Copy link
Contributor

@rainest rainest commented Sep 21, 2020

What this PR does / why we need it:
Remove deprecated 0.x.x flags. Remove logic for giving deprecated flags
precedece. Update docs to mention modern flags only.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #840

Special notes for your reviewer:
Related tests removed entirely, as we no longer have any deprecated flags. Will we have any in the future? Probably. Figured it made more sense to cut out the existing tests entirely for now rather than leaving no-op stubs. We can always retrieve the old diff assuming we need to re-add similar tests later for future deprecations.

Remove deprecated 0.x.x flags. Remove logic for giving deprecated flags
precedece. Update docs to mention modern flags only.
@rainest rainest added this to the 1.0.0 milestone Sep 21, 2020
kongAdminURL = newURL
flagURL := viper.GetString("kong-admin-url")
if flagURL != defaultKongAdminURL {
kongAdminURL = flagURL
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be simplified further as the complicated logic is going away:

config.KongAdminURL = viper.GetString("kong-admin-url")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking:

Food for thought: we might want to drop all the binding (config.Xxx = viper.GetXxx(Xxx)) logic by unmarshaling from viper directly into a config struct:

https://godoc.org/github.com/spf13/viper#UnmarshalExact

It would be even easier if we weren't using viper (because we could declare StringVar, IntVar instead of String, Int which would write directly to the config struct) but we need viper as long as we want to support the flag/envvar dualism of config values.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tracked in #868

@hbagdi hbagdi linked an issue Sep 22, 2020 that may be closed by this pull request
mflendrich
mflendrich previously approved these changes Sep 22, 2020
Copy link
Contributor

@mflendrich mflendrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

cli/ingress-controller/flags.go Outdated Show resolved Hide resolved
@rainest
Copy link
Contributor Author

rainest commented Sep 22, 2020

Remaining if block (for kong-admin-token) still looks legit--we have that for a special case admin header, and haven't deprecated the flag in question (probably for good reason, as it's the most likely one users will add anyway).

@hbagdi hbagdi merged commit 3e1954c into next Sep 25, 2020
@hbagdi hbagdi deleted the feat/remove-deprecated-flags branch September 25, 2020 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove deprecated flags
3 participants